<script setup lang="ts">
    import type {ModbusSignalPosition} from './type'
















    const baseApi = '/modbus-config/modbus-signal-position'

    

    const {loadData, loading, model} = useDetail<ModbusSignalPosition>(baseApi)

    defineExpose({ init: loadData })
</script>

<template>
    <el-empty v-if="!Object.keys(model).length" v-loading="loading" />
    <el-descriptions v-else v-loading="loading" :column="2" border >
            <el-descriptions-item label="salve配置编码" label-class-name="item-label" label-align="right">
                    <span class="txt-short">
                        {{ model.salveConfigCode }}
                    </span>
            </el-descriptions-item>
            <el-descriptions-item label="salve配置Id" label-class-name="item-label" label-align="right">
                    <span class="txt-short">
                        {{ model.salveConfigIdLabel }}
                    </span>
            </el-descriptions-item>
            <el-descriptions-item label="salveId" label-class-name="item-label" label-align="right">
                    <span class="txt-short">
                        {{ model.salveId }}
                    </span>
            </el-descriptions-item>
            <el-descriptions-item label="名称" label-class-name="item-label" label-align="right">
                    <span class="txt-short">
                        {{ model.name }}
                    </span>
            </el-descriptions-item>
            <el-descriptions-item label="数据类型" label-class-name="item-label" label-align="right">
                    <span class="txt-short">
                        {{ model.dataType }}
                    </span>
            </el-descriptions-item>
            <el-descriptions-item label="偏移量" label-class-name="item-label" label-align="right">
                    <span class="txt-short">
                        {{ model.offset }}
                    </span>
            </el-descriptions-item>
            <el-descriptions-item label="备注" label-class-name="item-label" label-align="right">
                    <span class="txt-short">
                        {{ model.remark }}
                    </span>
            </el-descriptions-item>
            <el-descriptions-item label="功能码" label-class-name="item-label" label-align="right">
                        <el-tag v-if="model.funLabel" :color="model.funLabel.ext?.color" effect="dark" type="info">
                            {{ model.funLabel?.label }}
                        </el-tag>
            </el-descriptions-item>
            <el-descriptions-item label="读写" label-class-name="item-label" label-align="right">
                        <el-tag v-if="model.readWriteAccessLabel" :color="model.readWriteAccessLabel.ext?.color" effect="dark" type="info">
                            {{ model.readWriteAccessLabel?.label }}
                        </el-tag>
            </el-descriptions-item>
            <el-descriptions-item label="创建人" label-class-name="item-label" label-align="right">
                    <span class="txt-short">
                        {{ model.createByLabel }}
                    </span>
            </el-descriptions-item>
            <el-descriptions-item label="创建时间" label-class-name="item-label" label-align="right">
                    <span class="txt-short">
                        {{ model.createTime }}
                    </span>
            </el-descriptions-item>
            <el-descriptions-item label="更新人" label-class-name="item-label" label-align="right">
                    <span class="txt-short">
                        {{ model.updateByLabel }}
                    </span>
            </el-descriptions-item>
            <el-descriptions-item label="更新时间" label-class-name="item-label" label-align="right">
                    <span class="txt-short">
                        {{ model.updateTime }}
                    </span>
            </el-descriptions-item>
    </el-descriptions>
</template>

<style scoped lang="scss">
    .el-descriptions {
        :deep(.el-descriptions__header) {
            margin: 0 10px 12px;
        }

            :deep(.item-label) {
                width: 120px;
            }
    }
</style>